package cn.edu.sbs.talent.controller.advice;

import cn.edu.sbs.talent.result.Result;
import org.apache.shiro.authz.UnauthorizedException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * MVCExceptionHandler
 *
 * @author ctidy
 * @since 2021/1/7
 */
@RestControllerAdvice
public class MVCExceptionHandler {

    @ExceptionHandler(UnauthorizedException.class)
    public Result onUnauthorizedException(UnauthorizedException e) {
        return Result.unauthorized("权限不足");
    }

}
